﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
using System.Runtime.Serialization;
using System.ServiceModel;

namespace streamingService.Entity
{
    [MessageContract]  
    public class RemoteFileInfo :IDisposable
    {
        [MessageHeader(MustUnderstand = true)]        
        public string FileName { get; set; }

        [MessageHeader(MustUnderstand = true)]        
        public long Length { get; set; }

        [MessageBodyMember(Order = 1)]        
        public Stream FileByteStream { get; set; }

        public void Dispose()
        {
            if (FileByteStream != null)
            {
                FileByteStream.Close();
                FileByteStream = null;
            }
        }   
    }
}